﻿using Basic.HrRemoteModel.DicItem;
using Basic.HrRemoteModel.DicItem.Model;
using WeDonekRpc.Client.Attr;

namespace Basic.FormExtendService.lmpl
{
    [ClassLifetimeAttr(ClassLifetimeType.SingleInstance)]
    internal class DictItemService : IDictItemService
    {
        public string[] FindDictValue ( DicItemFind param )
        {
            return new FindDicItemValue
            {
                Param = param
            }.Send();
        }

        public DicItemName[] GetNames ( Dictionary<long, string[]> dic )
        {
            return new BatchGetItemName
            {
                Param = dic
            }.Send();
        }

        public Dictionary<string, string> GetNames ( long dicId, string[] codes )
        {
            return new GetDicItemTexts
            {
                DicId = dicId,
                Values = codes
            }.Send();
        }
        public DicItem[] GetItems ( long dicId )
        {
            return new GetDicItems
            {
                DicId = dicId
            }.Send();
        }
    }
}
